package org.thread;

import com.google.common.util.concurrent.ThreadFactoryBuilder;

import java.util.concurrent.*;

public class ThreadPoolFactory {

    public static ThreadPoolExecutor getPool(String name){
        ThreadFactory factory = new ThreadFactoryBuilder().setNameFormat(name).build();
        return  new ThreadPoolExecutor(5,100,10000, TimeUnit.MILLISECONDS,new LinkedBlockingDeque<>(), factory, new ThreadPoolExecutor.DiscardPolicy());
    }
}
